#pragma once
#include "Manager.h"
#include <iostream>
#include "msclr\marshal_cppstd.h"
#include <string>
#include <time.h>


namespace CS2103v01 {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for EditTransaction
	/// </summary>
	public ref class EditTransaction : public System::Windows::Forms::Form
	{
	public:
		EditTransaction(int SN)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			TM = Manager::get();
			_SN=SN;
			toEdit=&(*TM->findTransaction(_SN));
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~EditTransaction()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Button^  button1;
	protected: 
	private: System::Windows::Forms::Button^  button2;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::DateTimePicker^  dateTimePicker1;
	private: System::Windows::Forms::ComboBox^  comboBox1;
	private: System::Windows::Forms::ComboBox^  comboBox2;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::TextBox^  textBox1;
	private: System::Windows::Forms::Label^  label5;
	private: System::Windows::Forms::ComboBox^  comboBox3;
	private: System::Windows::Forms::Label^  label6;
	private: System::Windows::Forms::ComboBox^  comboBox4;
	private: System::Windows::Forms::Label^  label7;
	private: System::Windows::Forms::Label^  label8;
	private: System::Windows::Forms::Label^  label9;
	private: System::Windows::Forms::Label^  label10;

	private:
		/// <summary>
		/// Required designer variable.
		Manager* TM;
		int _SN;
		Transaction* toEdit;
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->button1 = (gcnew System::Windows::Forms::Button());
			this->button2 = (gcnew System::Windows::Forms::Button());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->dateTimePicker1 = (gcnew System::Windows::Forms::DateTimePicker());
			this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
			this->comboBox2 = (gcnew System::Windows::Forms::ComboBox());
			this->label4 = (gcnew System::Windows::Forms::Label());
			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
			this->label5 = (gcnew System::Windows::Forms::Label());
			this->comboBox3 = (gcnew System::Windows::Forms::ComboBox());
			this->label6 = (gcnew System::Windows::Forms::Label());
			this->comboBox4 = (gcnew System::Windows::Forms::ComboBox());
			this->label7 = (gcnew System::Windows::Forms::Label());
			this->label8 = (gcnew System::Windows::Forms::Label());
			this->label9 = (gcnew System::Windows::Forms::Label());
			this->label10 = (gcnew System::Windows::Forms::Label());
			this->SuspendLayout();
			// 
			// button1
			// 
			this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->button1->Location = System::Drawing::Point(77, 385);
			this->button1->Name = L"button1";
			this->button1->Size = System::Drawing::Size(75, 23);
			this->button1->TabIndex = 0;
			this->button1->Text = L"Save";
			this->button1->UseVisualStyleBackColor = true;
			this->button1->Click += gcnew System::EventHandler(this, &EditTransaction::button1_Click);
			// 
			// button2
			// 
			this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->button2->Location = System::Drawing::Point(250, 385);
			this->button2->Name = L"button2";
			this->button2->Size = System::Drawing::Size(75, 23);
			this->button2->TabIndex = 1;
			this->button2->Text = L"Cancel";
			this->button2->UseVisualStyleBackColor = true;
			this->button2->Click += gcnew System::EventHandler(this, &EditTransaction::button2_Click);
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label1->Location = System::Drawing::Point(77, 43);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(36, 17);
			this->label1->TabIndex = 2;
			this->label1->Text = L"Type";
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 15, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label2->Location = System::Drawing::Point(119, 38);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(73, 27);
			this->label2->TabIndex = 3;
			this->label2->Text = L"label2";
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label3->Location = System::Drawing::Point(77, 105);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(88, 17);
			this->label3->TabIndex = 4;
			this->label3->Text = L"From Account";
			// 
			// dateTimePicker1
			// 
			this->dateTimePicker1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->dateTimePicker1->Location = System::Drawing::Point(172, 190);
			this->dateTimePicker1->Name = L"dateTimePicker1";
			this->dateTimePicker1->Size = System::Drawing::Size(199, 23);
			this->dateTimePicker1->TabIndex = 5;
			// 
			// comboBox1
			// 
			this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->comboBox1->FormattingEnabled = true;
			this->comboBox1->Location = System::Drawing::Point(172, 98);
			this->comboBox1->Name = L"comboBox1";
			this->comboBox1->Size = System::Drawing::Size(121, 25);
			this->comboBox1->TabIndex = 6;
			// 
			// comboBox2
			// 
			this->comboBox2->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox2->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->comboBox2->FormattingEnabled = true;
			this->comboBox2->Location = System::Drawing::Point(172, 144);
			this->comboBox2->Name = L"comboBox2";
			this->comboBox2->Size = System::Drawing::Size(121, 25);
			this->comboBox2->TabIndex = 7;
			// 
			// label4
			// 
			this->label4->AutoSize = true;
			this->label4->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label4->Location = System::Drawing::Point(77, 150);
			this->label4->Name = L"label4";
			this->label4->Size = System::Drawing::Size(73, 17);
			this->label4->TabIndex = 8;
			this->label4->Text = L"To Account";
			// 
			// textBox1
			// 
			this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->textBox1->Location = System::Drawing::Point(172, 280);
			this->textBox1->Name = L"textBox1";
			this->textBox1->Size = System::Drawing::Size(100, 23);
			this->textBox1->TabIndex = 9;
			// 
			// label5
			// 
			this->label5->AutoSize = true;
			this->label5->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label5->Location = System::Drawing::Point(77, 195);
			this->label5->Name = L"label5";
			this->label5->Size = System::Drawing::Size(35, 17);
			this->label5->TabIndex = 10;
			this->label5->Text = L"Date";
			// 
			// comboBox3
			// 
			this->comboBox3->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox3->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->comboBox3->FormattingEnabled = true;
			this->comboBox3->Items->AddRange(gcnew cli::array< System::Object^  >(24) {L"00", L"01", L"02", L"03", L"04", L"05", L"06", 
				L"07", L"08", L"09", L"10", L"11", L"12", L"13", L"14", L"15", L"16", L"17", L"18", L"19", L"20", L"21", L"22", L"23"});
			this->comboBox3->Location = System::Drawing::Point(172, 236);
			this->comboBox3->Name = L"comboBox3";
			this->comboBox3->Size = System::Drawing::Size(42, 25);
			this->comboBox3->TabIndex = 11;
			// 
			// label6
			// 
			this->label6->AutoSize = true;
			this->label6->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label6->Location = System::Drawing::Point(77, 240);
			this->label6->Name = L"label6";
			this->label6->Size = System::Drawing::Size(36, 17);
			this->label6->TabIndex = 12;
			this->label6->Text = L"Time";
			// 
			// comboBox4
			// 
			this->comboBox4->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox4->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->comboBox4->FormattingEnabled = true;
			this->comboBox4->Items->AddRange(gcnew cli::array< System::Object^  >(60) {L"00", L"01", L"02", L"03", L"04", L"05", L"06", 
				L"07", L"08", L"09", L"10", L"11", L"12", L"13", L"14", L"15", L"16", L"17", L"18", L"19", L"20", L"21", L"22", L"23", L"24", 
				L"25", L"26", L"27", L"28", L"29", L"30", L"31", L"32", L"33", L"34", L"35", L"36", L"37", L"38", L"39", L"40", L"41", L"42", 
				L"43", L"44", L"45", L"46", L"47", L"48", L"49", L"50", L"51", L"52", L"53", L"54", L"55", L"56", L"57", L"58", L"59"});
			this->comboBox4->Location = System::Drawing::Point(225, 236);
			this->comboBox4->Name = L"comboBox4";
			this->comboBox4->Size = System::Drawing::Size(42, 25);
			this->comboBox4->TabIndex = 13;
			// 
			// label7
			// 
			this->label7->AutoSize = true;
			this->label7->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label7->Location = System::Drawing::Point(77, 285);
			this->label7->Name = L"label7";
			this->label7->Size = System::Drawing::Size(53, 17);
			this->label7->TabIndex = 14;
			this->label7->Text = L"Amount";
			// 
			// label8
			// 
			this->label8->AutoSize = true;
			this->label8->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label8->Location = System::Drawing::Point(214, 240);
			this->label8->Name = L"label8";
			this->label8->Size = System::Drawing::Size(11, 17);
			this->label8->TabIndex = 15;
			this->label8->Text = L":";
			// 
			// label9
			// 
			this->label9->AutoSize = true;
			this->label9->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label9->ForeColor = System::Drawing::Color::Red;
			this->label9->Location = System::Drawing::Point(172, 123);
			this->label9->Name = L"label9";
			this->label9->Size = System::Drawing::Size(39, 16);
			this->label9->TabIndex = 16;
			this->label9->Text = L"label9";
			// 
			// label10
			// 
			this->label10->AutoSize = true;
			this->label10->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->label10->ForeColor = System::Drawing::Color::Red;
			this->label10->Location = System::Drawing::Point(172, 303);
			this->label10->Name = L"label10";
			this->label10->Size = System::Drawing::Size(45, 16);
			this->label10->TabIndex = 17;
			this->label10->Text = L"label10";
			// 
			// EditTransaction
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(403, 454);
			this->Controls->Add(this->label10);
			this->Controls->Add(this->label9);
			this->Controls->Add(this->label8);
			this->Controls->Add(this->label7);
			this->Controls->Add(this->comboBox4);
			this->Controls->Add(this->label6);
			this->Controls->Add(this->comboBox3);
			this->Controls->Add(this->label5);
			this->Controls->Add(this->textBox1);
			this->Controls->Add(this->label4);
			this->Controls->Add(this->comboBox2);
			this->Controls->Add(this->comboBox1);
			this->Controls->Add(this->dateTimePicker1);
			this->Controls->Add(this->label3);
			this->Controls->Add(this->label2);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->button2);
			this->Controls->Add(this->button1);
			this->Name = L"EditTransaction";
			this->Text = L"EditTransaction";
			this->Activated += gcnew System::EventHandler(this, &EditTransaction::EditTransaction_Activated);
			this->Load += gcnew System::EventHandler(this, &EditTransaction::EditTransaction_Load);
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion

		//@author A0090982W
	private: System::Void EditTransaction_Load(System::Object^  sender, System::EventArgs^  e) {
				 label9->Text="";
				 label10->Text="";
				 fillOriginalValue();
			 }
	private: System::Void EditTransaction_Activated(System::Object^  sender, System::EventArgs^  e) {
				 if(TM->findTransaction(_SN) == TM->getRecordAddr()->end())
				 {
					 MessageBox::Show("Transaction to edit is not found.");
					 this->Close();
				 }
				 toEdit=&*(TM->findTransaction(_SN));
				 fillOriginalValue();
			 }

	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
				 bool done=false;

				 if(toEdit->getType()==INCOME)
					 done = editIncome();
				 else if(toEdit->getType()==EXPENSE)
					 done = editExpense();
				 else if(toEdit->getType()==TRANSFER)
					 done = editTransfer();

				 if(done==true)
					 this->Close();
			 }
	private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
				 this->Close();
			 }

	private: bool editIncome() 
			 {
				 //check field
				 label9->Text="";
				 if(!checkField(textBox1, label10))
					 return false;

				 string account;
				 struct dateTime DT;
				 double amount;

				 account = msclr::interop::marshal_as<std::string>(comboBox2->Text);
				 DT.year = System::Convert::ToInt32(dateTimePicker1->Value.Year);
				 DT.month = System::Convert::ToInt32(dateTimePicker1->Value.Month);
				 DT.day = System::Convert::ToInt32(dateTimePicker1->Value.Day);
				 DT.hour = System::Convert::ToInt32(comboBox3->Text);
				 DT.minute = System::Convert::ToInt32(comboBox4->Text);
				 amount = System::Convert::ToDouble(textBox1->Text);

				 if(amount<0)
				 {
					 label10->Text="must be positive";
					 return false;
				 }

				 //edit transaction
				 if(TM->editTransaction(_SN, account, DT, amount))
					 return true;
				 else
					 return false;
			 }
	private: bool editExpense()
			 {
				 label9->Text="";
				 if(!checkField(textBox1, label10))
					 return false;

				 string account;
				 struct dateTime DT;
				 double amount;

				 account = msclr::interop::marshal_as<std::string>(comboBox1->Text);
				 DT.year = System::Convert::ToInt32(dateTimePicker1->Value.Year);
				 DT.month = System::Convert::ToInt32(dateTimePicker1->Value.Month);
				 DT.day = System::Convert::ToInt32(dateTimePicker1->Value.Day);
				 DT.hour = System::Convert::ToInt32(comboBox3->Text);
				 DT.minute = System::Convert::ToInt32(comboBox4->Text);
				 amount = System::Convert::ToDouble(textBox1->Text);

				 if(amount<0)
				 {
					 label10->Text="must be positive";
					 return false;
				 }

				 if(!TM->enoughBal(account, amount))
				 {
					 label10->Text="Not Enough Balance...";
					 return false;
				 }

				 if(TM->editTransaction(_SN, account, DT, amount))
					 return true;
				 else
					 return false;
			 }
	private: bool editTransfer()
			 {
				 //check field
				 label9->Text="";
				 if(comboBox1->Text==comboBox2->Text)
				 {
					 label9->Text="Please choose a different account";
					 return false;
				 }
				 if(!checkField(textBox1, label10))
					 return false;

				 string Faccount;
				 string Taccount;
				 struct dateTime DT;
				 double amount;
				 int SN;

				 Faccount = msclr::interop::marshal_as<std::string>(comboBox1->Text);
				 Taccount =  msclr::interop::marshal_as<std::string>(comboBox2->Text);
				 DT.year = System::Convert::ToInt32(dateTimePicker1->Value.Year);
				 DT.month = System::Convert::ToInt32(dateTimePicker1->Value.Month);
				 DT.day = System::Convert::ToInt32(dateTimePicker1->Value.Day);
				 DT.hour = System::Convert::ToInt32(comboBox3->Text);
				 DT.minute = System::Convert::ToInt32(comboBox4->Text);
				 amount = System::Convert::ToDouble(textBox1->Text);
				 
				 //check amount>=0
				 if(amount<0)
				 {
					 label10->Text="must be positive";
					 return false;
				 }

				 //check enough bal
				 if(!(TM->enoughBal(Faccount, amount)))
				 {
					 label10->Text="Not Enough Balance";
					 return false;
				 }

				 //edit transaction
				 if(TM->editTransaction(_SN, Faccount, Taccount, DT, amount))
					 return true;
				 else
					 return false;
			 }

	private: void setUpComboBox(string type, ComboBox^CB, String^ value)
			 {
				 if(type=="acc")
				 {
					 CB->Items->Clear();
					 if(!((TM->getAccAddr())->empty()))
					 {
						 list<string>::iterator iterA;
						 String ^ tempAcc;
						 for(iterA = (TM->getAccAddr())->begin(); iterA != (TM->getAccAddr())->end(); iterA++)
						 {
							 if(*iterA!="delete")
							 {
								 tempAcc =  msclr::interop::marshal_as<System::String^>(*iterA);
								 CB->Items->Add(tempAcc);
							 }
						 }
						 //initialize unchanged value
						 if(value!="")
						 {
							 int i = CB->FindString(value);
							 CB->SelectedIndex = i;
						 }
						 else
							 CB->SelectedIndex = 0;
					 }
				 }
				 else if(type=="cat")
				 {
					 CB->Items->Clear();

					 if(!((TM->getCatAddr())->empty()))
					 {
						 list<string>::iterator iterC = TM->getCatAddr()->begin();
						 String ^ tempCat;
						 for(; iterC != (TM->getCatAddr())->end(); iterC++)
						 {
							 if(*iterC!="Income" && *iterC!="Transfer")
							 {
								 tempCat =  msclr::interop::marshal_as<System::String^>(*iterC);
								 CB->Items->Add(tempCat);
							 }
						 }
						 //initialize unchanged value
						 if(value!="")
						 {
							 int i = CB->FindString(value);
							 CB->SelectedIndex = i;
						 }
						 else
							 CB->SelectedIndex = 0;
					 }
				 }
				 else if(type=="hour")
				 {
					 CB->SelectedIndex = System::Convert::ToInt32(value);
				 }
				 else if(type=="min")
				 {
					 CB->SelectedIndex = System::Convert::ToInt32(value);
				 }

				 else
					 return;
			 }
	private: bool checkField(TextBox^ amt, Label^ amtL)
			 {
				 amtL->Text="";
				 bool miss=false;
				 bool format=true;

				 //check empty field
				 if(amt->Text=="")
				 {
					 amtL->Text="missing";
					 miss = true;
				 }
				 if(miss)
					 return false;

				 //check format
				 if(!(TM->checkDouble(msclr::interop::marshal_as<std::string>(amt->Text))))
				 {
					 amtL->Text="Not numeric";
					 format=false;
				 }
				 else if(!TM->checkDP(msclr::interop::marshal_as<std::string>(amt->Text)))
				 {
					 amtL->Text="exceeded precision";
					 format = false;
				 }
				 return format;
			 }
	private: void fillOriginalValue()
			 {
				 //fill in account
				 if(toEdit->getType()==INCOME)
				 {
					 label2->Text="Income";
					 comboBox1->Enabled=false;
					 setUpComboBox("acc", comboBox2, msclr::interop::marshal_as<System::String^>(toEdit->getAccount()));
				 }
				 else if(toEdit->getType()==EXPENSE)
				 {
					 label2->Text="Expense";
					 comboBox2->Enabled=false;
					 setUpComboBox("acc", comboBox1, msclr::interop::marshal_as<System::String^>(toEdit->getAccount()));
				 }
				 else if(toEdit->getType()==TRANSFER)
				 {
					 label2->Text="Transfer";
					 setUpComboBox("acc", comboBox1, msclr::interop::marshal_as<System::String^>(toEdit->getAccountFrom()));
					 setUpComboBox("acc", comboBox2, msclr::interop::marshal_as<System::String^>(toEdit->getAccountTo()));
				 }

				 //fill in time
				 setUpComboBox("hour", comboBox3, System::Convert::ToString(toEdit->getDateTime().hour));
				 setUpComboBox("min", comboBox4, System::Convert::ToString(toEdit->getDateTime().minute));

				 //fill in amount
				 textBox1->Text=System::Convert::ToString(toEdit->getAmount());

				 //fill in date
				 DateTime tempDT(toEdit->getDateTime().year, toEdit->getDateTime().month, toEdit->getDateTime().day);
				 dateTimePicker1->Value=tempDT;
			 }
	private: bool checkChanges()
			 {
				 //any changed field will be indicated
				 return true;
			 }

	};
}
